﻿#ifndef QTABLEWIDGETEX_H
#define QTABLEWIDGETEX_H

#include <QObject>
#include <QWidget>
#include <QCursor>
#include <QMenu>
#include <QTableWidget>

#include <QContextMenuEvent>


class QTableWidgetEx : public QTableWidget
{
    Q_OBJECT
public:
    QTableWidgetEx();
    QTableWidgetEx(QWidget *parent=0);

    void contextMenuEvent(QContextMenuEvent *);//右键处理覆盖
    void append_hex_string_to_last_row(QString sndOrRcv, uint8_t buf[], uint16_t len);
    void append_hex_string_to_last_row(QString &dir_str,
                                       QString &byte_cnt_str,
                                       QString &frame_str,
                                       QString &frame_char_str);

    QMenu *menu;
    QAction* Act_DelRow;
    QAction* Act_ClearAll;

private slots:
   void on_Act_DelRow_triggered();
   void on_Act_ClearAll_triggered();

};

#endif // QTABLEWIDGETEX_H
